package presentation.panels;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

import metier.exceptions.ResetDBException;
import metier.userService.UserService;
import metier.userService.UserServiceImpl;

public class PanelResetDB extends JPanel{

	/**
	 * Serail ID
	 */
	private static final long serialVersionUID = -84566604290069006L;
	
	UserService userService ;
	
	public PanelResetDB(){
		super() ;
		userService = new UserServiceImpl() ;
		
		JButton resetDB = new JButton("Reset User DataBase") ;
		resetDB.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {
				try {
					userService.resetDataBase() ;
				} catch (ResetDBException e) {
					e.printStackTrace();
				}
			}
		}) ;
		this.add(resetDB) ;
	}

}
